package edu.zhuravlev.trainingbot.conifg;


import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.telegram.telegrambots.client.okhttp.OkHttpTelegramClient;
import org.telegram.telegrambots.meta.generics.TelegramClient;


@Configuration
@RequiredArgsConstructor
public class TrainingBotConfig {

    private final BotConfig botConfig;

    @Bean
    public TelegramClient telegramClient() {
        return new OkHttpTelegramClient(botConfig.getToken());
    }

}
